package cn.edu.ujn.project.supermarket.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ujn.project.common.core.text.Convert;
import cn.edu.ujn.project.supermarket.domain.ReturnGoods;
import cn.edu.ujn.project.supermarket.mapper.ReturnGoodsMapper;
import cn.edu.ujn.project.supermarket.service.IReturnGoodsService;

/**
 * 退货Service业务层处理
 * 
 * @author zhaomh
 * @date 2023-11-14
 */
@Service
public class ReturnGoodsServiceImpl implements IReturnGoodsService 
{
    @Autowired
    private ReturnGoodsMapper returnGoodsMapper;

    /**
     * 查询退货
     * 
     * @param returnId 退货主键
     * @return 退货
     */
    @Override
    public ReturnGoods selectReturnGoodsByReturnId(String returnId)
    {
        return returnGoodsMapper.selectReturnGoodsByReturnId(returnId);
    }

    /**
     * 查询退货列表
     * 
     * @param returnGoods 退货
     * @return 退货
     */
    @Override
    public List<ReturnGoods> selectReturnGoodsList(ReturnGoods returnGoods)
    {
        return returnGoodsMapper.selectReturnGoodsList(returnGoods);
    }

    /**
     * 新增退货
     * 
     * @param returnGoods 退货
     * @return 结果
     */
    @Override
    public int insertReturnGoods(ReturnGoods returnGoods)
    {
        return returnGoodsMapper.insertReturnGoods(returnGoods);
    }

    /**
     * 修改退货
     * 
     * @param returnGoods 退货
     * @return 结果
     */
    @Override
    public int updateReturnGoods(ReturnGoods returnGoods)
    {
        return returnGoodsMapper.updateReturnGoods(returnGoods);
    }

    /**
     * 批量删除退货
     * 
     * @param returnIds 需要删除的退货主键
     * @return 结果
     */
    @Override
    public int deleteReturnGoodsByReturnIds(String returnIds)
    {
        return returnGoodsMapper.deleteReturnGoodsByReturnIds(Convert.toStrArray(returnIds));
    }

    /**
     * 删除退货信息
     * 
     * @param returnId 退货主键
     * @return 结果
     */
    @Override
    public int deleteReturnGoodsByReturnId(String returnId)
    {
        return returnGoodsMapper.deleteReturnGoodsByReturnId(returnId);
    }
}
